#ifndef JABSTRACTCANDIDATEPANEL_H
#define JABSTRACTCANDIDATEPANEL_H

#include <QWidget>
#include <QTECore/QTEGlobal>
#include "qtevirtualkeyboardglobal.h"

namespace QTE
{

class Q_DECL_HIDDEN JAbstractCandidatePanel : public QWidget
{
	Q_OBJECT

public:
	explicit JAbstractCandidatePanel(QWidget *parent = nullptr);
	virtual ~JAbstractCandidatePanel() = 0;

public:
	inline virtual bool isValid() const { return false; }

public slots:
	virtual void predicts(const QString &text);
	virtual void input(const QString &text);
	virtual void input(Qt::Key key);
	virtual void defaultInput();

Q_SIGNALS:
	void postKeyEvent(QKeyEvent *event);
};

#define CandidatePanelClassName(enumType) \
	QString("%1_candidate_%2").arg(enumType).arg(inputMethodName(enumType)).toLocal8Bit()

#define CandidatePanel_register(Type, enumType, ...) \
	QTE_type_register(Type, CandidatePanelClassName(enumType), __VA_ARGS__)

} //namespace QTE


#endif //JABSTRACTCANDIDATEPANEL_H
